FUNCTION

require

pure function require(value: boolean, [message: text]): unit

Asserts a boolean condition.

Parameters

  • value — the boolean condition to check
  • message — the message for the exception to be thrown if the condition is false

Throws

  • exception — if the provided condition is false

Since

0.6.0


pure function require<T>(value: T?, [message: text]): T

Asserts that a value is not null.

Parameters

  • value — the value to check, and returned if it is not null
  • message — the error message to be thrown if the value is null

Returns

the passed value, but with type cast from T? to T

Throws

  • exception — if the provided value is null

Since

0.6.0

© 2026 Chromia